/*
 * main.cpp
 *
 *  Created on: 14.05.2009
 *      Author: michael
 */

#include <iostream>
#include "RelaisCardController.h"
#include "RelaisCardModel.h"

using namespace std;

int main(){
	RelaisCardModel model;
	RelaisCardController card = RelaisCardController("/dev/ttyS0", model);
	int input = 1;
	int state;
	while(input <= 8 && input > 0){
		card.print();
		cout << "Bitte Schaltzustand der ersten Karte angeben: ";
		cin >> input >> state;
		switch (state) {
		case 0:
			card.setRelais(1,input,false);
			break;
		case 1:
			card.setRelais(1, input, true);
			break;
		default:
			cout << "Bitte 0 für aus und 1 für an verwenden!" << endl;
		}
	}
	return 0;
}
